package com.xinqi.modules.course.demonstrate.service.impl;

import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import com.xinqi.modules.course.course.mapper.CourseMapper;
import com.xinqi.modules.course.demonstrate.service.DemoResourceService;
import lombok.RequiredArgsConstructor;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * 示范课程 -- 资料库
 */

@Service("demoResourceService")
@RequiredArgsConstructor
public class DemoResourceServiceImpl implements DemoResourceService {

    private final IdentifierGenerator identifierGenerator;
    private final CourseMapper courseMapper;

    /**
     * 生成资料库数据
     */

    @Override
    @Async("threadPoolTaskExecutor")
    public void initResourceSql(Long userId, Long classId, Map<String, String> idsMap, Map<String, String> chapterMap) {
        StringBuilder sql = new StringBuilder();
        // 主表信息
        String resourceSql = "INSERT INTO data_bank.co_course_resource (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `title`, `content_type`, `content`, `fileurls`, `videos`, `images`, `class_id`, `user_id`, `chapter_id`, `synchro`, `class_ids`, `download`, `allow_drag`, `allow_speedup`, `is_studeescore`, `now_release`, `timing`, `release_time`, `end_time`, `status`, `extra`, `is_delete`, `delete_time`, `donwload_num`) " +
            "VALUES (" + idsMap.get("1663459329386012674") + ", 1645325062446964737, '2023-05-30 16:16:24', 1661185385489694721, '2023-05-31 09:04:46', '熟悉新奇资料——关于课程的设置', 2, NULL, '[{\\\"url\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434572190676-1.如何创建课程.doc\\\",\\\"name\\\":\\\"1.如何创建课程.doc\\\",\\\"type\\\":1,\\\"filename\\\":\\\"1.如何创建课程.doc\\\",\\\"fileurl\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434572190676-1.如何创建课程.doc\\\",\\\"fileUrl\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434572190676-1.如何创建课程.doc\\\",\\\"size\\\":18432,\\\"ossFileName\\\":\\\"1685434572190676-1.如何创建课程.doc\\\",\\\"progress\\\":100},{\\\"url\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434572192213-2.如何置顶_归档_解散_转让课程.docx\\\",\\\"name\\\":\\\"2.如何置顶_归档_解散_转让课程.docx\\\",\\\"type\\\":1,\\\"filename\\\":\\\"2.如何置顶_归档_解散_转让课程.docx\\\",\\\"fileurl\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434572192213-2.如何置顶_归档_解散_转让课程.docx\\\",\\\"fileUrl\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434572192213-2.如何置顶_归档_解散_转让课程.docx\\\",\\\"size\\\":12419,\\\"ossFileName\\\":\\\"1685434572192213-2.如何置顶_归档_解散_转让课程.docx\\\",\\\"progress\\\":100},{\\\"url\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434572192851-3.找不到您所创建的课程？.doc\\\",\\\"name\\\":\\\"3.找不到您所创建的课程？.doc\\\",\\\"type\\\":1,\\\"filename\\\":\\\"3.找不到您所创建的课程？.doc\\\",\\\"fileurl\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434572192851-3.找不到您所创建的课程？.doc\\\",\\\"fileUrl\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434572192851-3.找不到您所创建的课程？.doc\\\",\\\"size\\\":13824,\\\"ossFileName\\\":\\\"1685434572192851-3.找不到您所创建的课程？.doc\\\",\\\"progress\\\":100}]', NULL, NULL, 1661184856792928257, 1645325062446964737, NULL, 0, NULL, 1, 0, 0, 0, 0, 0, '2023-05-30 20:13:45', '2023-05-31 20:13:45', 1, NULL, 0, NULL, 0)," +
            "(" + idsMap.get("1663459721134006274") + ", 1645325062446964737, '2023-05-30 16:17:58', 1661185385489694721, '2023-05-31 09:04:44', '熟悉新奇资料——如何发布作业', 2, NULL, '[{\\\"url\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434672924133-1.如何发布作业？.doc\\\",\\\"name\\\":\\\"1.如何发布作业？.doc\\\",\\\"type\\\":1,\\\"filename\\\":\\\"1.如何发布作业？.doc\\\",\\\"fileurl\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434672924133-1.如何发布作业？.doc\\\",\\\"fileUrl\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434672924133-1.如何发布作业？.doc\\\",\\\"size\\\":16896,\\\"ossFileName\\\":\\\"1685434672924133-1.如何发布作业？.doc\\\",\\\"progress\\\":100},{\\\"url\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434672925759-2.如何批阅作业？.doc\\\",\\\"name\\\":\\\"2.如何批阅作业？.doc\\\",\\\"type\\\":1,\\\"filename\\\":\\\"2.如何批阅作业？.doc\\\",\\\"fileurl\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434672925759-2.如何批阅作业？.doc\\\",\\\"fileUrl\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434672925759-2.如何批阅作业？.doc\\\",\\\"size\\\":14336,\\\"ossFileName\\\":\\\"1685434672925759-2.如何批阅作业？.doc\\\",\\\"progress\\\":100},{\\\"url\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434672928337-3.如何分享优秀作业？.doc\\\",\\\"name\\\":\\\"3.如何分享优秀作业？.doc\\\",\\\"type\\\":1,\\\"filename\\\":\\\"3.如何分享优秀作业？.doc\\\",\\\"fileurl\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434672928337-3.如何分享优秀作业？.doc\\\",\\\"fileUrl\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434672928337-3.如何分享优秀作业？.doc\\\",\\\"size\\\":12288,\\\"ossFileName\\\":\\\"1685434672928337-3.如何分享优秀作业？.doc\\\",\\\"progress\\\":100}]', NULL, NULL, 1661184856792928257, 1645325062446964737, NULL, 0, NULL, 1, 0, 0, 0, 0, 0, '2023-05-30 20:13:43', '2023-05-31 20:13:43', 1, NULL, 0, NULL, 0)," +
            "(" + idsMap.get("1663461179422203905") + ", 1645325062446964737, '2023-05-30 16:23:45', 1661185385489694721, '2023-05-31 09:04:42', '熟悉新奇资料——如何编辑互动试题', 2, NULL, '[{\\\"url\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434869880839-1.如何添加互动课件？.doc\\\",\\\"name\\\":\\\"1.如何添加互动课件？.doc\\\",\\\"type\\\":1,\\\"filename\\\":\\\"1.如何添加互动课件？.doc\\\",\\\"fileurl\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434869880839-1.如何添加互动课件？.doc\\\",\\\"fileUrl\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434869880839-1.如何添加互动课件？.doc\\\",\\\"size\\\":13824,\\\"ossFileName\\\":\\\"1685434869880839-1.如何添加互动课件？.doc\\\",\\\"progress\\\":100},{\\\"url\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434869880359-2.如何添加_编辑互动课件中的试题？.doc\\\",\\\"name\\\":\\\"2.如何添加_编辑互动课件中的试题？.doc\\\",\\\"type\\\":1,\\\"filename\\\":\\\"2.如何添加_编辑互动课件中的试题？.doc\\\",\\\"fileurl\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434869880359-2.如何添加_编辑互动课件中的试题？.doc\\\",\\\"fileUrl\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434869880359-2.如何添加_编辑互动课件中的试题？.doc\\\",\\\"size\\\":17920,\\\"ossFileName\\\":\\\"1685434869880359-2.如何添加_编辑互动课件中的试题？.doc\\\",\\\"progress\\\":100},{\\\"url\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434869881346-3.如何添加互动视频？doc.doc\\\",\\\"name\\\":\\\"3.如何添加互动视频？doc.doc\\\",\\\"type\\\":1,\\\"filename\\\":\\\"3.如何添加互动视频？doc.doc\\\",\\\"fileurl\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434869881346-3.如何添加互动视频？doc.doc\\\",\\\"fileUrl\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685434869881346-3.如何添加互动视频？doc.doc\\\",\\\"size\\\":12288,\\\"ossFileName\\\":\\\"1685434869881346-3.如何添加互动视频？doc.doc\\\",\\\"progress\\\":100}]', NULL, NULL, 1661184856792928257, 1645325062446964737, NULL, 0, NULL, 1, 0, 0, 0, 0, 0, '2023-05-30 20:13:40', '2023-06-01 20:13:40', 1, NULL, 0, NULL, 0)," +
            "(" + idsMap.get("1663505937125400578") + ", 1645325062446964737, '2023-05-30 19:21:37', 1, '2023-05-31 11:30:00', '认识锈斑豹猫—互动视频', 6, NULL, NULL, '[{\\\"url\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685445670027466-《大猫》：锈斑豹猫 世界上体形最小的猫科动物之一.mp4\\\",\\\"name\\\":\\\"《大猫》：锈斑豹猫 世界上体形最小的猫科动物之一.mp4\\\",\\\"type\\\":3,\\\"filename\\\":\\\"《大猫》：锈斑豹猫 世界上体形最小的猫科动物之一.mp4\\\",\\\"fileurl\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685445670027466-《大猫》：锈斑豹猫 世界上体形最小的猫科动物之一.mp4\\\",\\\"fileUrl\\\":\\\"https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685445670027466-《大猫》：锈斑豹猫 世界上体形最小的猫科动物之一.mp4\\\",\\\"size\\\":13869821,\\\"ossFileName\\\":\\\"1685445670027466-《大猫》：锈斑豹猫 世界上体形最小的猫科动物之一.mp4\\\",\\\"width\\\":852,\\\"height\\\":480,\\\"duration\\\":71}]', NULL, 1661184856792928257, 1645325062446964737, 1661193644769972226, 0, NULL, 1, 0, 0, 0, 1, 0, '2023-05-30 20:13:30', '2023-05-31 11:30:00', 1, NULL, 0, NULL, 0);";

        // 更新班级信息
        resourceSql = resourceSql.replaceAll("1661184856792928257", classId.toString());
        // 更新章节
        Set<String> keyList = chapterMap.keySet();
        for (String item : keyList) {
            String value = chapterMap.get(item);
            resourceSql.replaceAll(item, value);
        }
        sql.append(resourceSql);

        // 内容ID遍历使用
        Set<String> mapList = idsMap.keySet();

        // 资料库学生记录
        String logSql = "INSERT INTO data_bank.co_course_resource_student_log(`id`, `create_by`, `create_time`, `update_by`, `update_time`, `is_delete`, `delete_time`, `class_id`, `content_type`, `content_id`, `student_id`, `is_read`, `study_status`, `student_score`, `study_duration`, `read_num`, `study_progress`, `study_page`, `total_page`, `last_access_time`, `play_time`, `download_num`, `duration`, `video_total`, `is_add_later`) " +
            "VALUES (" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:16:24', 1645325062446964737, '2023-05-30 16:16:24', 0, 0, 1661184856792928257, 2, 1663459329386012674, 1650458704827445249, 0, 0, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:16:24', 1653986821394567169, '2023-05-30 21:27:06', 0, 0, 1661184856792928257, 2, 1663459329386012674, 1653986821394567169, 1, 2, 0.00, NULL, 1, NULL, NULL, NULL, '2023-05-30 21:27:06', NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:16:24', 1654693737893134337, '2023-05-30 20:55:11', 0, 0, 1661184856792928257, 2, 1663459329386012674, 1654693737893134337, 1, 2, 0.00, NULL, 1, NULL, NULL, NULL, '2023-05-30 20:55:11', NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:16:24', 1645325062446964737, '2023-05-30 16:16:24', 0, 0, 1661184856792928257, 2, 1663459329386012674, 1655410589569056769, 0, 0, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:16:24', 1645325062446964737, '2023-05-30 16:16:24', 0, 0, 1661184856792928257, 2, 1663459329386012674, 1655650372358701057, 0, 0, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:16:24', 1656548738307391489, '2023-05-31 08:46:56', 0, 0, 1661184856792928257, 2, 1663459329386012674, 1656548738307391489, 1, 2, 0.00, NULL, 1, NULL, NULL, NULL, '2023-05-31 08:46:56', NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:16:24', 1645325062446964737, '2023-05-30 16:16:24', 0, 0, 1661184856792928257, 2, 1663459329386012674, 1659403958154625026, 0, 0, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:16:24', 1661185385489694721, '2023-05-31 09:04:46', 0, 0, 1661184856792928257, 2, 1663459329386012674, 1661185385489694721, 1, 2, 0.00, NULL, 1, NULL, NULL, NULL, '2023-05-31 09:04:46', NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:17:58', 1650458704827445249, '2023-05-30 21:19:30', 0, 0, 1661184856792928257, 2, 1663459721134006274, 1650458704827445249, 1, 2, 0.00, NULL, 1, NULL, NULL, NULL, '2023-05-30 21:19:30', NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:17:58', 1653986821394567169, '2023-05-30 21:27:04', 0, 0, 1661184856792928257, 2, 1663459721134006274, 1653986821394567169, 1, 2, 0.00, NULL, 1, NULL, NULL, NULL, '2023-05-30 21:27:04', NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:17:58', 1654693737893134337, '2023-05-30 20:55:24', 0, 0, 1661184856792928257, 2, 1663459721134006274, 1654693737893134337, 1, 2, 0.00, NULL, 2, NULL, NULL, NULL, '2023-05-30 20:55:24', NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:17:58', 1645325062446964737, '2023-05-30 16:17:58', 0, 0, 1661184856792928257, 2, 1663459721134006274, 1655410589569056769, 0, 0, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:17:58', 1645325062446964737, '2023-05-30 16:17:58', 0, 0, 1661184856792928257, 2, 1663459721134006274, 1655650372358701057, 0, 0, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:17:58', 1656548738307391489, '2023-05-31 08:46:54', 0, 0, 1661184856792928257, 2, 1663459721134006274, 1656548738307391489, 1, 2, 0.00, NULL, 1, NULL, NULL, NULL, '2023-05-31 08:46:54', NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:17:58', 1645325062446964737, '2023-05-30 16:17:58', 0, 0, 1661184856792928257, 2, 1663459721134006274, 1659403958154625026, 0, 0, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:17:58', 1661185385489694721, '2023-05-31 09:04:44', 0, 0, 1661184856792928257, 2, 1663459721134006274, 1661185385489694721, 1, 2, 0.00, NULL, 1, NULL, NULL, NULL, '2023-05-31 09:04:44', NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:23:45', 1650458704827445249, '2023-05-30 21:19:28', 0, 0, 1661184856792928257, 2, 1663461179422203905, 1650458704827445249, 1, 2, 0.00, NULL, 1, NULL, NULL, NULL, '2023-05-30 21:19:28', NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:23:45', 1653986821394567169, '2023-05-30 21:27:02', 0, 0, 1661184856792928257, 2, 1663461179422203905, 1653986821394567169, 1, 2, 0.00, NULL, 1, NULL, NULL, NULL, '2023-05-30 21:27:02', NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:23:45', 1654693737893134337, '2023-05-30 20:55:07', 0, 0, 1661184856792928257, 2, 1663461179422203905, 1654693737893134337, 1, 2, 0.00, NULL, 1, NULL, NULL, NULL, '2023-05-30 20:55:07', NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:23:45', 1645325062446964737, '2023-05-30 16:23:45', 0, 0, 1661184856792928257, 2, 1663461179422203905, 1655410589569056769, 0, 0, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:23:45', 1645325062446964737, '2023-05-30 16:23:45', 0, 0, 1661184856792928257, 2, 1663461179422203905, 1655650372358701057, 0, 0, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:23:45', 1656548738307391489, '2023-05-31 08:46:52', 0, 0, 1661184856792928257, 2, 1663461179422203905, 1656548738307391489, 1, 2, 0.00, NULL, 1, NULL, NULL, NULL, '2023-05-31 08:46:52', NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:23:45', 1645325062446964737, '2023-05-30 16:23:45', 0, 0, 1661184856792928257, 2, 1663461179422203905, 1659403958154625026, 0, 0, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 16:23:45', 1661185385489694721, '2023-05-31 09:04:42', 0, 0, 1661184856792928257, 2, 1663461179422203905, 1661185385489694721, 1, 2, 0.00, NULL, 1, NULL, NULL, NULL, '2023-05-31 09:04:42', NULL, 0, NULL, 0.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 19:21:37', 1650458704827445249, '2023-05-30 21:19:19', 0, 0, 1661184856792928257, 6, 1663505937125400578, 1650458704827445249, 1, 2, 3.00, NULL, 1, 1.00, NULL, NULL, '2023-05-30 21:19:19', NULL, 0, 72.38, 71.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 19:21:37', 1653986821394567169, '2023-05-30 21:28:38', 0, 0, 1661184856792928257, 6, 1663505937125400578, 1653986821394567169, 1, 1, 3.00, NULL, 1, 0.21, NULL, NULL, '2023-05-30 21:28:38', NULL, 0, 15.02, 71.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 19:21:37', 1654693737893134337, '2023-05-30 20:53:57', 0, 0, 1661184856792928257, 6, 1663505937125400578, 1654693737893134337, 1, 2, 3.00, NULL, 3, 1.00, NULL, NULL, '2023-05-30 20:53:57', NULL, 0, 72.38, 71.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 19:21:37', 1645325062446964737, '2023-05-30 19:21:37', 0, 0, 1661184856792928257, 6, 1663505937125400578, 1655410589569056769, 0, 0, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 71.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 19:21:37', 1645325062446964737, '2023-05-30 19:21:37', 0, 0, 1661184856792928257, 6, 1663505937125400578, 1655650372358701057, 0, 0, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 71.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 19:21:37', 1656548738307391489, '2023-05-31 10:30:25', 0, 0, 1661184856792928257, 6, 1663505937125400578, 1656548738307391489, 1, 2, 3.00, NULL, 2, 1.00, NULL, NULL, '2023-05-31 10:30:25', NULL, 0, 72.38, 71.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 19:21:37', 1645325062446964737, '2023-05-30 19:21:37', 0, 0, 1661184856792928257, 6, 1663505937125400578, 1659403958154625026, 0, 0, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 71.00, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1645325062446964737, '2023-05-30 19:21:37', 1661185385489694721, '2023-05-31 09:07:09', 0, 0, 1661184856792928257, 6, 1663505937125400578, 1661185385489694721, 1, 2, 3.00, NULL, 1, 1.00, NULL, NULL, '2023-05-31 09:07:09', NULL, 0, 72.38, 71.00, 0);";
        // 更新内容
        for (String item : mapList) {
            String value = idsMap.get(item);
            logSql = logSql.replaceAll(item, value);
        }
        // 更新班级ID
        logSql = logSql.replaceAll("1661184856792928257", classId.toString());
        sql.append(logSql);

        // 更新切片信息
        String[] partIds = new String[]{"1663451230709276674", "1663451230742831106", "1663451230767996931", "1663451230797357058"
            , "1663451230822522881", "1663451230843494402", "1663506363417681922", "1663506506003046402", "1663506658361139201"};
        Map<String, String> partMap = new HashMap<>();
        for (int i = 0; i < partIds.length; i++) {
            Long id = identifierGenerator.nextId(null).longValue();
            partMap.put(partIds[i], id.toString());
        }
        String partSql = "INSERT INTO data_bank.co_course_resource_part(`id`, `create_by`, `create_time`, `update_by`, `update_time`, `is_delete`, `delete_time`, `content_id`, `resource_id`, `item_type`, `file_type`, `page_number`, `time_pause`, `video_img_url`, `file_url`, `interaction_type`, `interaction_file`, `images`) " +
            "VALUES (" + partMap.get("1663506363417681922") + ", 1645325062446964737, '2023-05-30 19:23:18', 1, '2023-05-30 19:24:28', 0, 0, 1663505937125400578, NULL, 6, 2, 1, 4.27, 'https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685445670027466-《大猫》：锈斑豹猫 世界上体形最小的猫科动物之一.mp4?x-oss-process=video/snapshot,t_4270,f_jpg', NULL, 2, 'https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685445794738481-1570861713_b323e63a63be1eccad7d8cb000fcf6c4.jpeg', NULL)," +
            "(" + partMap.get("1663506506003046402") + ", 1645325062446964737, '2023-05-30 19:23:52', 1, '2023-05-30 19:24:28', 0, 0, 1663505937125400578, NULL, 6, 2, 2, 9.74, 'https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685445670027466-《大猫》：锈斑豹猫 世界上体形最小的猫科动物之一.mp4?x-oss-process=video/snapshot,t_9740,f_jpg', NULL, 3, 'https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685445829846431-《大猫》：锈斑豹猫 世界上体形最小的猫科动物之一.docx', NULL)," +
            "(" + partMap.get("1663506658361139201") + ", 1645325062446964737, '2023-05-30 19:24:28', 1, '2023-05-30 19:24:28', 0, 0, 1663505937125400578, NULL, 6, 2, 3, 14.82, 'https://xinqiclass.oss-cn-hangzhou.aliyuncs.com/2023-05-30/1685445670027466-《大猫》：锈斑豹猫 世界上体形最小的猫科动物之一.mp4?x-oss-process=video/snapshot,t_14820,f_jpg', NULL, 1, NULL, NULL);";
        // 更新内容ID
        for (String item : mapList) {
            String value = idsMap.get(item);
            partSql = partSql.replaceAll(item, value);
        }
        sql.append(partSql);

        // 互动环节题目记录
        String[] questionIds = new String[]{"1663453352796413953", "1663454154407600130", "1663455686096117761", "1663457012452483074"
            , "1663457643061895169", "1663458267803475970", "1663507848461344769", "1663508128292724738", "1663508512331587585"};
        Map<String, String> questionMap = new HashMap<>();
        for (int i = 0; i < questionIds.length; i++) {
            Long id = identifierGenerator.nextId(null).longValue();
            questionMap.put(questionIds[i], id.toString());
        }
        String questionSql = "INSERT INTO data_bank.co_course_question_library(`id`, `create_by`, `create_time`, `update_by`, `update_time`, `is_delete`, `delete_time`, `content_id`, `content`, `content_type`, `resource_part_id`, `type`, `question`, `question_file`, `answer`, `answer_file`, `options`, `score`, `sort`, `analysis`, `analysis_file`) " +
            "VALUES (" + questionMap.get("1663507848461344769") + ", 1645325062446964737, '2023-05-30 19:29:12', 1645325062446964737, '2023-05-30 19:29:12', 0, 0, 1663505937125400578, '加强野生动物的保护区和监管。这是保护野生动物最有效的方法之一', 6, 1663506658361139201, 1, '判断题', NULL, 'A', NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":1,\\\"val\\\":\\\"对\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"错\\\"}]', 1.00, 1, '加强野生动物的保护区和监管。这是保护野生动物最有效的方法之一，可以保护野生动物的栖息地和生存环境，减少人类活动对野生动物的干扰和破坏。', NULL)," +
            "(" + questionMap.get("1663508128292724738") + ", 1645325062446964737, '2023-05-30 19:30:19', 1645325062446964737, '2023-05-30 19:30:19', 0, 0, 1663505937125400578, '以下哪个行为有可能对野生动物造成伤害？\\n', 6, 1663506658361139201, 2, '单选题', NULL, 'C', NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":0,\\\"val\\\":\\\"在野生动物保护区里观察野生动物\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"放生被困在自家花园里的小鸟\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"C\\\",\\\"selected\\\":1,\\\"val\\\":\\\"在野外留下大量垃圾和废弃物\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"D\\\",\\\"selected\\\":0,\\\"val\\\":\\\"喂养动物并与它们互动\\\"}]', 1.00, 2, '在野外留下大量垃圾和废弃物。这种行为会破坏野生动物的栖息地和生存环境，对野生动物造成伤害和威胁。同时，垃圾和废弃物还可能被野生动物误食，导致中毒和死亡。', NULL)," +
            "(" + questionMap.get("1663508512331587585") + ", 1645325062446964737, '2023-05-30 19:31:50', 1645325062446964737, '2023-05-30 19:31:50', 0, 0, 1663505937125400578, '以下哪些行为属于保护野生动物？\\n', 6, 1663506658361139201, 3, '多选题', NULL, 'A,C,D', NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":1,\\\"val\\\":\\\"支持和参与野生动物保护组织\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"购买野生动物制品以展示自己的财富和地位\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"C\\\",\\\"selected\\\":1,\\\"val\\\":\\\"不购买野生动物制品并教育他人不要购买\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"D\\\",\\\"selected\\\":1,\\\"val\\\":\\\" 捡拾并妥善处理动物遗骸以保持环境的清洁和卫生\\\"}]', 1.00, 3, '购买野生动物制品以展示自己的财富和地位。这种行为会刺激野生动物市场的需求，导致更多的野生动物被捕杀和贩卖，加剧野生动物的灭绝危机。', NULL);";
        // 更新内容ID
        for (String item : mapList) {
            String value = idsMap.get(item);
            questionSql = questionSql.replaceAll(item, value);
        }
        // 更新切片ID
        Set<String> partList = partMap.keySet();
        for (String item : partList) {
            String value = partMap.get(item);
            questionSql = questionSql.replaceAll(item, value);
        }
        sql.append(questionSql);

        // 更新学生答题记录
        String stuQuestionSql = "INSERT INTO data_bank.co_course_interaction_student_log(`id`, `create_by`, `create_time`, `update_by`, `update_time`, `course_id`, `is_delete`, `delete_time`, `class_id`, `content_id`, `resource_part_id`, `student_id`, `status`, `study_time`, `score`, `type`, `is_read`, `submit_time`, `consult_num`) " +
            "VALUES (" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:23:18', 1, '2023-05-30 19:23:18', NULL, 0, NULL, NULL, 1663505937125400578, 1663506363417681922, 1650458704827445249, 0, NULL, 0.00, 6, 0, NULL, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:23:18', 1, '2023-05-30 19:23:18', NULL, 0, NULL, NULL, 1663505937125400578, 1663506363417681922, 1653986821394567169, 0, NULL, 0.00, 6, 0, NULL, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:23:18', 1, '2023-05-30 19:23:18', NULL, 0, NULL, NULL, 1663505937125400578, 1663506363417681922, 1654693737893134337, 0, NULL, 0.00, 6, 0, NULL, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:23:18', 1, '2023-05-30 19:23:18', NULL, 0, NULL, NULL, 1663505937125400578, 1663506363417681922, 1655410589569056769, 0, NULL, 0.00, 6, 0, NULL, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:23:18', 1, '2023-05-30 19:23:18', NULL, 0, NULL, NULL, 1663505937125400578, 1663506363417681922, 1655650372358701057, 0, NULL, 0.00, 6, 0, NULL, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:23:18', 1, '2023-05-30 19:23:18', NULL, 0, NULL, NULL, 1663505937125400578, 1663506363417681922, 1656548738307391489, 0, NULL, 0.00, 6, 0, NULL, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:23:18', 1, '2023-05-30 19:23:18', NULL, 0, NULL, NULL, 1663505937125400578, 1663506363417681922, 1659403958154625026, 0, NULL, 0.00, 6, 0, NULL, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:23:18', 1, '2023-05-30 19:23:18', NULL, 0, NULL, NULL, 1663505937125400578, 1663506363417681922, 1661185385489694721, 0, NULL, 0.00, 6, 0, NULL, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:23:52', 1, '2023-05-30 19:23:52', NULL, 0, NULL, NULL, 1663505937125400578, 1663506506003046402, 1650458704827445249, 0, NULL, 0.00, 6, 0, NULL, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:23:52', 1, '2023-05-30 19:23:52', NULL, 0, NULL, NULL, 1663505937125400578, 1663506506003046402, 1653986821394567169, 0, NULL, 0.00, 6, 0, NULL, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:23:52', 1, '2023-05-30 19:23:52', NULL, 0, NULL, NULL, 1663505937125400578, 1663506506003046402, 1654693737893134337, 0, NULL, 0.00, 6, 0, NULL, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:23:52', 1, '2023-05-30 19:23:52', NULL, 0, NULL, NULL, 1663505937125400578, 1663506506003046402, 1655410589569056769, 0, NULL, 0.00, 6, 0, NULL, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:23:52', 1, '2023-05-30 19:23:52', NULL, 0, NULL, NULL, 1663505937125400578, 1663506506003046402, 1655650372358701057, 0, NULL, 0.00, 6, 0, NULL, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:23:52', 1, '2023-05-30 19:23:52', NULL, 0, NULL, NULL, 1663505937125400578, 1663506506003046402, 1656548738307391489, 0, NULL, 0.00, 6, 0, NULL, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:23:52', 1, '2023-05-30 19:23:52', NULL, 0, NULL, NULL, 1663505937125400578, 1663506506003046402, 1659403958154625026, 0, NULL, 0.00, 6, 0, NULL, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:23:52', 1, '2023-05-30 19:23:52', NULL, 0, NULL, NULL, 1663505937125400578, 1663506506003046402, 1661185385489694721, 0, NULL, 0.00, 6, 0, NULL, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:24:29', 1650458704827445249, '2023-05-30 21:18:21', NULL, 0, NULL, NULL, 1663505937125400578, 1663506658361139201, 1650458704827445249, 2, NULL, 3.00, 6, 1, '2023-05-30 21:18:21', 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:24:29', 1653986821394567169, '2023-05-30 21:28:38', NULL, 0, NULL, NULL, 1663505937125400578, 1663506658361139201, 1653986821394567169, 2, NULL, 3.00, 6, 1, '2023-05-30 21:28:38', 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:24:29', 1654693737893134337, '2023-05-30 20:53:00', NULL, 0, NULL, NULL, 1663505937125400578, 1663506658361139201, 1654693737893134337, 2, NULL, 3.00, 6, 1, '2023-05-30 20:53:00', 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:24:29', 1, '2023-05-30 19:31:51', NULL, 0, NULL, NULL, 1663505937125400578, 1663506658361139201, 1655410589569056769, 0, NULL, 3.00, 6, 0, NULL, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:24:29', 1, '2023-05-30 19:31:51', NULL, 0, NULL, NULL, 1663505937125400578, 1663506658361139201, 1655650372358701057, 0, NULL, 3.00, 6, 0, NULL, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:24:29', 1656548738307391489, '2023-05-31 08:47:40', NULL, 0, NULL, NULL, 1663505937125400578, 1663506658361139201, 1656548738307391489, 2, NULL, 3.00, 6, 1, '2023-05-31 08:47:40', 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:24:29', 1, '2023-05-30 19:31:51', NULL, 0, NULL, NULL, 1663505937125400578, 1663506658361139201, 1659403958154625026, 0, NULL, 3.00, 6, 0, NULL, 0)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:24:29', 1661185385489694721, '2023-05-31 09:06:12', NULL, 0, NULL, NULL, 1663505937125400578, 1663506658361139201, 1661185385489694721, 2, NULL, 3.00, 6, 1, '2023-05-31 09:06:12', 0);";
        // 更新内容ID
        for (String item : mapList) {
            String value = idsMap.get(item);
            stuQuestionSql = stuQuestionSql.replaceAll(item, value);
        }
        // 更新切片ID
        for (String item : partList) {
            String value = partMap.get(item);
            stuQuestionSql = stuQuestionSql.replaceAll(item, value);
        }
        // 更新班级ID
        stuQuestionSql.replaceAll("1661184856792928257", classId.toString());
        sql.append(stuQuestionSql);

        String stuAnswerSql = "INSERT INTO data_bank.co_course_interaction_submit(`id`, `create_by`, `create_time`, `update_by`, `update_time`, `is_delete`, `delete_time`, `content_id`, `user_id`, `resource_part_id`, `question_id`, `type`, `question`, `question_file`, `answer`, `answer_file`, `options`, `score`, `analysis`, `analysis_file`, `student_answer`, `student_answer_file`, `answer_remark`, `student_score`, `is_reply`, `is_right`, `sort`) " +
            "VALUES (" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1650458704827445249, '2023-05-30 21:18:21', 0, 0, 1663505937125400578, 1650458704827445249, 1663506658361139201, 1663507848461344769, 1, '判断题', NULL, 'A', NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":1,\\\"val\\\":\\\"对\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"错\\\"}]', 1.00, '加强野生动物的保护区和监管。这是保护野生动物最有效的方法之一，可以保护野生动物的栖息地和生存环境，减少人类活动对野生动物的干扰和破坏。', NULL, 'A', NULL, NULL, 1.00, 1, 1, 1)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1650458704827445249, '2023-05-30 21:18:21', 0, 0, 1663505937125400578, 1650458704827445249, 1663506658361139201, 1663508128292724738, 2, '单选题', NULL, 'C', NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":0,\\\"val\\\":\\\"在野生动物保护区里观察野生动物\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"放生被困在自家花园里的小鸟\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"C\\\",\\\"selected\\\":1,\\\"val\\\":\\\"在野外留下大量垃圾和废弃物\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"D\\\",\\\"selected\\\":0,\\\"val\\\":\\\"喂养动物并与它们互动\\\"}]', 1.00, '在野外留下大量垃圾和废弃物。这种行为会破坏野生动物的栖息地和生存环境，对野生动物造成伤害和威胁。同时，垃圾和废弃物还可能被野生动物误食，导致中毒和死亡。', NULL, 'C', NULL, NULL, 1.00, 1, 1, 2)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1650458704827445249, '2023-05-30 21:18:21', 0, 0, 1663505937125400578, 1650458704827445249, 1663506658361139201, 1663508512331587585, 3, '多选题', NULL, 'A,C,D', NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":1,\\\"val\\\":\\\"支持和参与野生动物保护组织\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"购买野生动物制品以展示自己的财富和地位\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"C\\\",\\\"selected\\\":1,\\\"val\\\":\\\"不购买野生动物制品并教育他人不要购买\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"D\\\",\\\"selected\\\":1,\\\"val\\\":\\\" 捡拾并妥善处理动物遗骸以保持环境的清洁和卫生\\\"}]', 1.00, '购买野生动物制品以展示自己的财富和地位。这种行为会刺激野生动物市场的需求，导致更多的野生动物被捕杀和贩卖，加剧野生动物的灭绝危机。', NULL, 'A,C,D', NULL, NULL, 1.00, 1, 1, 3)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1653986821394567169, '2023-05-30 21:28:38', 0, 0, 1663505937125400578, 1653986821394567169, 1663506658361139201, 1663507848461344769, 1, '判断题', NULL, 'A', NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":1,\\\"val\\\":\\\"对\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"错\\\"}]', 1.00, '加强野生动物的保护区和监管。这是保护野生动物最有效的方法之一，可以保护野生动物的栖息地和生存环境，减少人类活动对野生动物的干扰和破坏。', NULL, 'A', NULL, NULL, 1.00, 1, 1, 1)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1653986821394567169, '2023-05-30 21:28:38', 0, 0, 1663505937125400578, 1653986821394567169, 1663506658361139201, 1663508128292724738, 2, '单选题', NULL, 'C', NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":0,\\\"val\\\":\\\"在野生动物保护区里观察野生动物\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"放生被困在自家花园里的小鸟\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"C\\\",\\\"selected\\\":1,\\\"val\\\":\\\"在野外留下大量垃圾和废弃物\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"D\\\",\\\"selected\\\":0,\\\"val\\\":\\\"喂养动物并与它们互动\\\"}]', 1.00, '在野外留下大量垃圾和废弃物。这种行为会破坏野生动物的栖息地和生存环境，对野生动物造成伤害和威胁。同时，垃圾和废弃物还可能被野生动物误食，导致中毒和死亡。', NULL, 'C', NULL, NULL, 1.00, 1, 1, 2)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1653986821394567169, '2023-05-30 21:28:38', 0, 0, 1663505937125400578, 1653986821394567169, 1663506658361139201, 1663508512331587585, 3, '多选题', NULL, 'A,C,D', NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":1,\\\"val\\\":\\\"支持和参与野生动物保护组织\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"购买野生动物制品以展示自己的财富和地位\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"C\\\",\\\"selected\\\":1,\\\"val\\\":\\\"不购买野生动物制品并教育他人不要购买\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"D\\\",\\\"selected\\\":1,\\\"val\\\":\\\" 捡拾并妥善处理动物遗骸以保持环境的清洁和卫生\\\"}]', 1.00, '购买野生动物制品以展示自己的财富和地位。这种行为会刺激野生动物市场的需求，导致更多的野生动物被捕杀和贩卖，加剧野生动物的灭绝危机。', NULL, 'A,C,D', NULL, NULL, 1.00, 1, 1, 3)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1654693737893134337, '2023-05-30 20:53:00', 0, 0, 1663505937125400578, 1654693737893134337, 1663506658361139201, 1663507848461344769, 1, '判断题', NULL, 'A', NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":1,\\\"val\\\":\\\"对\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"错\\\"}]', 1.00, '加强野生动物的保护区和监管。这是保护野生动物最有效的方法之一，可以保护野生动物的栖息地和生存环境，减少人类活动对野生动物的干扰和破坏。', NULL, 'A', NULL, NULL, 1.00, 1, 1, 1)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1654693737893134337, '2023-05-30 20:53:00', 0, 0, 1663505937125400578, 1654693737893134337, 1663506658361139201, 1663508128292724738, 2, '单选题', NULL, 'C', NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":0,\\\"val\\\":\\\"在野生动物保护区里观察野生动物\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"放生被困在自家花园里的小鸟\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"C\\\",\\\"selected\\\":1,\\\"val\\\":\\\"在野外留下大量垃圾和废弃物\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"D\\\",\\\"selected\\\":0,\\\"val\\\":\\\"喂养动物并与它们互动\\\"}]', 1.00, '在野外留下大量垃圾和废弃物。这种行为会破坏野生动物的栖息地和生存环境，对野生动物造成伤害和威胁。同时，垃圾和废弃物还可能被野生动物误食，导致中毒和死亡。', NULL, 'C', NULL, NULL, 1.00, 1, 1, 2)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1654693737893134337, '2023-05-30 20:53:00', 0, 0, 1663505937125400578, 1654693737893134337, 1663506658361139201, 1663508512331587585, 3, '多选题', NULL, 'A,C,D', NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":1,\\\"val\\\":\\\"支持和参与野生动物保护组织\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"购买野生动物制品以展示自己的财富和地位\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"C\\\",\\\"selected\\\":1,\\\"val\\\":\\\"不购买野生动物制品并教育他人不要购买\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"D\\\",\\\"selected\\\":1,\\\"val\\\":\\\" 捡拾并妥善处理动物遗骸以保持环境的清洁和卫生\\\"}]', 1.00, '购买野生动物制品以展示自己的财富和地位。这种行为会刺激野生动物市场的需求，导致更多的野生动物被捕杀和贩卖，加剧野生动物的灭绝危机。', NULL, 'A,C,D', NULL, NULL, 1.00, 1, 1, 3)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1, '2023-05-30 19:31:51', 0, 0, 1663505937125400578, 1655410589569056769, 1663506658361139201, 1663507848461344769, 1, '判断题', NULL, NULL, NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":1,\\\"val\\\":\\\"对\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"错\\\"}]', 1.00, '加强野生动物的保护区和监管。这是保护野生动物最有效的方法之一，可以保护野生动物的栖息地和生存环境，减少人类活动对野生动物的干扰和破坏。', NULL, NULL, NULL, NULL, NULL, 0, 0, 1)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1, '2023-05-30 19:31:51', 0, 0, 1663505937125400578, 1655410589569056769, 1663506658361139201, 1663508128292724738, 2, '单选题', NULL, NULL, NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":0,\\\"val\\\":\\\"在野生动物保护区里观察野生动物\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"放生被困在自家花园里的小鸟\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"C\\\",\\\"selected\\\":1,\\\"val\\\":\\\"在野外留下大量垃圾和废弃物\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"D\\\",\\\"selected\\\":0,\\\"val\\\":\\\"喂养动物并与它们互动\\\"}]', 1.00, '在野外留下大量垃圾和废弃物。这种行为会破坏野生动物的栖息地和生存环境，对野生动物造成伤害和威胁。同时，垃圾和废弃物还可能被野生动物误食，导致中毒和死亡。', NULL, NULL, NULL, NULL, NULL, 0, 0, 2)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1, '2023-05-30 19:31:51', 0, 0, 1663505937125400578, 1655410589569056769, 1663506658361139201, 1663508512331587585, 3, '多选题', NULL, NULL, NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":1,\\\"val\\\":\\\"支持和参与野生动物保护组织\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"购买野生动物制品以展示自己的财富和地位\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"C\\\",\\\"selected\\\":1,\\\"val\\\":\\\"不购买野生动物制品并教育他人不要购买\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"D\\\",\\\"selected\\\":1,\\\"val\\\":\\\" 捡拾并妥善处理动物遗骸以保持环境的清洁和卫生\\\"}]', 1.00, '购买野生动物制品以展示自己的财富和地位。这种行为会刺激野生动物市场的需求，导致更多的野生动物被捕杀和贩卖，加剧野生动物的灭绝危机。', NULL, NULL, NULL, NULL, NULL, 0, 0, 3)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1, '2023-05-30 19:31:51', 0, 0, 1663505937125400578, 1655650372358701057, 1663506658361139201, 1663507848461344769, 1, '判断题', NULL, NULL, NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":1,\\\"val\\\":\\\"对\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"错\\\"}]', 1.00, '加强野生动物的保护区和监管。这是保护野生动物最有效的方法之一，可以保护野生动物的栖息地和生存环境，减少人类活动对野生动物的干扰和破坏。', NULL, NULL, NULL, NULL, NULL, 0, 0, 1)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1, '2023-05-30 19:31:51', 0, 0, 1663505937125400578, 1655650372358701057, 1663506658361139201, 1663508128292724738, 2, '单选题', NULL, NULL, NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":0,\\\"val\\\":\\\"在野生动物保护区里观察野生动物\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"放生被困在自家花园里的小鸟\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"C\\\",\\\"selected\\\":1,\\\"val\\\":\\\"在野外留下大量垃圾和废弃物\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"D\\\",\\\"selected\\\":0,\\\"val\\\":\\\"喂养动物并与它们互动\\\"}]', 1.00, '在野外留下大量垃圾和废弃物。这种行为会破坏野生动物的栖息地和生存环境，对野生动物造成伤害和威胁。同时，垃圾和废弃物还可能被野生动物误食，导致中毒和死亡。', NULL, NULL, NULL, NULL, NULL, 0, 0, 2)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1, '2023-05-30 19:31:51', 0, 0, 1663505937125400578, 1655650372358701057, 1663506658361139201, 1663508512331587585, 3, '多选题', NULL, NULL, NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":1,\\\"val\\\":\\\"支持和参与野生动物保护组织\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"购买野生动物制品以展示自己的财富和地位\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"C\\\",\\\"selected\\\":1,\\\"val\\\":\\\"不购买野生动物制品并教育他人不要购买\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"D\\\",\\\"selected\\\":1,\\\"val\\\":\\\" 捡拾并妥善处理动物遗骸以保持环境的清洁和卫生\\\"}]', 1.00, '购买野生动物制品以展示自己的财富和地位。这种行为会刺激野生动物市场的需求，导致更多的野生动物被捕杀和贩卖，加剧野生动物的灭绝危机。', NULL, NULL, NULL, NULL, NULL, 0, 0, 3)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1656548738307391489, '2023-05-31 08:47:40', 0, 0, 1663505937125400578, 1656548738307391489, 1663506658361139201, 1663507848461344769, 1, '判断题', NULL, 'A', NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":1,\\\"val\\\":\\\"对\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"错\\\"}]', 1.00, '加强野生动物的保护区和监管。这是保护野生动物最有效的方法之一，可以保护野生动物的栖息地和生存环境，减少人类活动对野生动物的干扰和破坏。', NULL, 'A', NULL, NULL, 1.00, 1, 1, 1)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1656548738307391489, '2023-05-31 08:47:40', 0, 0, 1663505937125400578, 1656548738307391489, 1663506658361139201, 1663508128292724738, 2, '单选题', NULL, 'C', NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":0,\\\"val\\\":\\\"在野生动物保护区里观察野生动物\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"放生被困在自家花园里的小鸟\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"C\\\",\\\"selected\\\":1,\\\"val\\\":\\\"在野外留下大量垃圾和废弃物\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"D\\\",\\\"selected\\\":0,\\\"val\\\":\\\"喂养动物并与它们互动\\\"}]', 1.00, '在野外留下大量垃圾和废弃物。这种行为会破坏野生动物的栖息地和生存环境，对野生动物造成伤害和威胁。同时，垃圾和废弃物还可能被野生动物误食，导致中毒和死亡。', NULL, 'C', NULL, NULL, 1.00, 1, 1, 2)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1656548738307391489, '2023-05-31 08:47:40', 0, 0, 1663505937125400578, 1656548738307391489, 1663506658361139201, 1663508512331587585, 3, '多选题', NULL, 'A,C,D', NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":1,\\\"val\\\":\\\"支持和参与野生动物保护组织\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"购买野生动物制品以展示自己的财富和地位\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"C\\\",\\\"selected\\\":1,\\\"val\\\":\\\"不购买野生动物制品并教育他人不要购买\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"D\\\",\\\"selected\\\":1,\\\"val\\\":\\\" 捡拾并妥善处理动物遗骸以保持环境的清洁和卫生\\\"}]', 1.00, '购买野生动物制品以展示自己的财富和地位。这种行为会刺激野生动物市场的需求，导致更多的野生动物被捕杀和贩卖，加剧野生动物的灭绝危机。', NULL, 'A,C,D', NULL, NULL, 1.00, 1, 1, 3)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1, '2023-05-30 19:31:51', 0, 0, 1663505937125400578, 1659403958154625026, 1663506658361139201, 1663507848461344769, 1, '判断题', NULL, NULL, NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":1,\\\"val\\\":\\\"对\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"错\\\"}]', 1.00, '加强野生动物的保护区和监管。这是保护野生动物最有效的方法之一，可以保护野生动物的栖息地和生存环境，减少人类活动对野生动物的干扰和破坏。', NULL, NULL, NULL, NULL, NULL, 0, 0, 1)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1, '2023-05-30 19:31:51', 0, 0, 1663505937125400578, 1659403958154625026, 1663506658361139201, 1663508128292724738, 2, '单选题', NULL, NULL, NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":0,\\\"val\\\":\\\"在野生动物保护区里观察野生动物\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"放生被困在自家花园里的小鸟\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"C\\\",\\\"selected\\\":1,\\\"val\\\":\\\"在野外留下大量垃圾和废弃物\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"D\\\",\\\"selected\\\":0,\\\"val\\\":\\\"喂养动物并与它们互动\\\"}]', 1.00, '在野外留下大量垃圾和废弃物。这种行为会破坏野生动物的栖息地和生存环境，对野生动物造成伤害和威胁。同时，垃圾和废弃物还可能被野生动物误食，导致中毒和死亡。', NULL, NULL, NULL, NULL, NULL, 0, 0, 2)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1, '2023-05-30 19:31:51', 0, 0, 1663505937125400578, 1659403958154625026, 1663506658361139201, 1663508512331587585, 3, '多选题', NULL, NULL, NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":1,\\\"val\\\":\\\"支持和参与野生动物保护组织\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"购买野生动物制品以展示自己的财富和地位\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"C\\\",\\\"selected\\\":1,\\\"val\\\":\\\"不购买野生动物制品并教育他人不要购买\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"D\\\",\\\"selected\\\":1,\\\"val\\\":\\\" 捡拾并妥善处理动物遗骸以保持环境的清洁和卫生\\\"}]', 1.00, '购买野生动物制品以展示自己的财富和地位。这种行为会刺激野生动物市场的需求，导致更多的野生动物被捕杀和贩卖，加剧野生动物的灭绝危机。', NULL, NULL, NULL, NULL, NULL, 0, 0, 3)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1661185385489694721, '2023-05-31 09:06:12', 0, 0, 1663505937125400578, 1661185385489694721, 1663506658361139201, 1663507848461344769, 1, '判断题', NULL, 'A', NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":1,\\\"val\\\":\\\"对\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"错\\\"}]', 1.00, '加强野生动物的保护区和监管。这是保护野生动物最有效的方法之一，可以保护野生动物的栖息地和生存环境，减少人类活动对野生动物的干扰和破坏。', NULL, 'A', NULL, NULL, 1.00, 1, 1, 1)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1661185385489694721, '2023-05-31 09:06:12', 0, 0, 1663505937125400578, 1661185385489694721, 1663506658361139201, 1663508128292724738, 2, '单选题', NULL, 'C', NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":0,\\\"val\\\":\\\"在野生动物保护区里观察野生动物\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"放生被困在自家花园里的小鸟\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"C\\\",\\\"selected\\\":1,\\\"val\\\":\\\"在野外留下大量垃圾和废弃物\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"D\\\",\\\"selected\\\":0,\\\"val\\\":\\\"喂养动物并与它们互动\\\"}]', 1.00, '在野外留下大量垃圾和废弃物。这种行为会破坏野生动物的栖息地和生存环境，对野生动物造成伤害和威胁。同时，垃圾和废弃物还可能被野生动物误食，导致中毒和死亡。', NULL, 'C', NULL, NULL, 1.00, 1, 1, 2)," +
            "(" + identifierGenerator.nextId(userId) + ", 1, '2023-05-30 19:31:51', 1661185385489694721, '2023-05-31 09:06:12', 0, 0, 1663505937125400578, 1661185385489694721, 1663506658361139201, 1663508512331587585, 3, '多选题', NULL, 'A,C,D', NULL, '[{\\\"fileUrls\\\":[],\\\"id\\\":\\\"A\\\",\\\"selected\\\":1,\\\"val\\\":\\\"支持和参与野生动物保护组织\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"B\\\",\\\"selected\\\":0,\\\"val\\\":\\\"购买野生动物制品以展示自己的财富和地位\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"C\\\",\\\"selected\\\":1,\\\"val\\\":\\\"不购买野生动物制品并教育他人不要购买\\\"},{\\\"fileUrls\\\":[],\\\"id\\\":\\\"D\\\",\\\"selected\\\":1,\\\"val\\\":\\\" 捡拾并妥善处理动物遗骸以保持环境的清洁和卫生\\\"}]', 1.00, '购买野生动物制品以展示自己的财富和地位。这种行为会刺激野生动物市场的需求，导致更多的野生动物被捕杀和贩卖，加剧野生动物的灭绝危机。', NULL, 'A,C,D', NULL, NULL, 1.00, 1, 1, 3)";
        // 更新内容ID
        for (String item : mapList) {
            String value = idsMap.get(item);
            stuAnswerSql = stuAnswerSql.replaceAll(item, value);
        }
        // 更新切片ID
        for (String item : partList) {
            String value = partMap.get(item);
            stuAnswerSql = stuAnswerSql.replaceAll(item, value);
        }
        // 更新题目ID
        Set<String> questionList = questionMap.keySet();
        for (String item : questionList) {
            String value = questionMap.get(item);
            stuAnswerSql = stuAnswerSql.replaceAll(item, value);
        }
        sql.append(stuAnswerSql);

        // 执行SQL语句
        courseMapper.insertAllSql(sql.toString());
    }

}
